<template>
	<view class="page">
		<Navbar :title="title"></Navbar>
		<view>
			<!-- 	<view class="u-flex u-row-between u-col-center u-margin-bottom-20">
				<view class="u-flex u-row-between u-col-center u-font-32">
					<image style="width: 10rpx;height: 30rpx;margin-right: 8rpx;" src="/static/image/icon-home-menu.png"></image>
					{{ title }}
				</view>
				<view class="u-flex u-row-between u-col-center u-tips-color"></view>
			</view> -->
			<view class="u-flex u-col-top u-margin-bottom-30 home-content" v-for="item in dataList" :key="item.ID"
				@click="link_to_page('/pages-home/pages/promotional/detail?id=' + item.ID)">
				<image style="width: 220rpx;height: 194rpx;background-color: #CCCCCC;" :src="imgBaseUrl + item.ImgUrl"
					mode="aspectFill"></image>
				<view class="u-flex-1 u-padding-22">
					<view class="u-font-30 u-font-w-6 u-padding-bottom-10 u-line-1" style="width: 400rpx;">
						{{ item.Title }}</view>
					<view class="u-font-28 u-line-3" style="width: 420rpx;color: #636363;">{{ item.Subtitle }}</view>
					<!-- <view class="u-font-24 u-text-right u-padding-top-22 u-tips-color" style="position: absolute;bottom: 20rpx;right: 20rpx;">服务介绍</view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: 1,
				title: '',
				dataList: []
			};
		},
		onLoad(e) {
			this.type = e.type;
			let newType = '';
			if (e.type == 1) {
				this.title = '指导单位';
				// 指导单位
				newType = 'df15373bb88841a098972ea5c45ecef7';
			} else if (e.type == 2) {
				this.title = '支持单位';
				// 支持单位
				newType = 'de295cc4c164478a92b93a632543c54b';
			} else if (e.type == 3) {
				this.title = '爱心企业';
				// 爱心企业
				newType = 'a8c6f50dcd6d4d2eba066b67e2b6670c';
			} else if (e.type == 4) {
				this.title = '保洁法务';
				// 保洁法务
				newType = '9c8547d147414b3b8d43ec83debf7c49';
			}else if (e.type == 5) {
				this.title = '公告信息';
				// 公告信息
				newType = 'e451163131014ac19fa7448776a63ea6';
			}
			if (!newType) return;
			this.$u.api.NewsInformation({
				newType
			}).then(res => {
				if (res && res.code == 0) {
					this.dataList = res.data;
				}
			});
		},
		methods: {}
	};
</script>

<style lang="scss" scoped>
	.page {
		padding: 20rpx;
		background-color: #f4f5f7;
	}

	.home-content {
		position: relative;
		border-radius: 16rpx;
		background-color: #fff;
		overflow: hidden;
	}
</style>